/**
 * 
 */
package com.explgo.backend.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import org.codehaus.jackson.annotate.JsonBackReference;

/**
 * The plan comment
 * 
 * @author Jialiang(Cain) Wang
 * 
 */
@Entity
public class Comment extends PkIdEntity {
	private static final long serialVersionUID = -2963309888736964448L;

	/**
	 * The comment author
	 * */
	private User user;

	/**
	 * The comment content
	 * */
	private String content;

	/**
	 * The target plan.
	 * */
	private Plan plan;

	/**
	 * If this comment likes the target plan.
	 * */
	private boolean likeThisPlan;

	/**
	 * @return the user
	 */
	@ManyToOne
	@JsonBackReference
	public User getUser() {
		return user;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the plan
	 */
	@ManyToOne
	@JsonBackReference
	public Plan getPlan() {
		return plan;
	}

	/**
	 * @param plan
	 *            the plan to set
	 */
	public void setPlan(Plan plan) {
		this.plan = plan;
	}

	/**
	 * @return the like
	 */
	public boolean isLikeThisPlan() {
		return likeThisPlan;
	}

	/**
	 * @param like
	 *            the like to set
	 */
	public void setLikeThisPlan(boolean like) {
		this.likeThisPlan = like;
	}

}
